<?php
/****
* 个人用户主页
*/
import('@.Model.Where.EventWhereMachine');
class UserAction extends InitAction{
    protected function _initialize(){
    	parent::_initialize();
    }
    public function index(){
      $uid= $_GET['uid'];
      if ($uid){
          $user= M('Account')->find($uid);
          $this->assign('user', $user);
      }
      //创建的活动
      $map= new EventWhereMachine();
      $map->author($uid);
      $EM= new EventModel();
      $create= $EM->where($map->get())->limit(10)->select();
      $this->assign('mycreate', $create);

    	$sv = new Model();
    	$save = $sv->query("select * from `notice_event`,( select `eid` from `notice_event_mark` where '{$uid}'=`notice_event_mark`.`uid` and `notice_event_mark`.`take`!=0) as `haha` where `notice_event`.`id`=`haha`.`eid`");
    	$this->assign('mymark',$save);	
    	
    	$wish = $sv->query("select * from `notice_event`,( select `eid` from `notice_event_mark` where '{$uid}'=`notice_event_mark`.`uid` and `notice_event_mark`.`wish`!=0) as `mama` where `notice_event`.`id`=`mama`.`eid`");
      $this->assign('mywish',$wish);

      //$this->assign('timeline', $tl);

      $fm= new FriendModel();
      $this->assign('friends', $fm->getFriend());
      $this->display('index');
    }
    public function login(){
    }
}
?>